//
//  BusinessService+WD.m
//  SelfDriving
//
//  Created by apple on 16/2/25.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "BusinessService+WD.h"
#import "AddressBookFriendModel.h"

@implementation BusinessService(WD)
-(void)getdynamic_guest:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dynamic_guest
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           // 6月9日，改：为空的话就不回调
//                           if ([newsObjs count]!=0) {
//                               success(newsObjs);
//                               return;
//                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               
                               NSDictionary * dic = [NSDictionary dictionaryWithObjectsAndKeys:userlist,@"list",result[@"pageInfo"][@"total"],@"total", nil];
                               success(dic);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)getdelete_dynamic:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:delete_dynamic
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               
                               NSDictionary * dic = [NSDictionary dictionaryWithObjectsAndKeys:userlist,@"list",result[@"pageInfo"][@"total"],@"total", nil];
                               success(dic);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}

-(void)jubao_statistics:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:jubao_statisticsurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)jubao_list:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:jubao_listurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];


}
-(void)award_daka:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:award_dakaurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}

-(void)share_statistics:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:share_statisticsurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)shoudao_or_fachu:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    NSString *url;
    if ([[parameters objectForKey:@"type"] isEqualToString:@"收到的红包"]) {
        url = shoudaourl;
    }else{
        url = fachuurl;
    }
    [self.http sendRequest:url
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                               [focusModel serializationWithDictionary:[result objectForKey:@"data"]];
                               [userlist addObject:focusModel];
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)consume_list:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:consume_listurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)member_fee:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:member_feeurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)blackList:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:blackListurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)black:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:blackurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)jubao:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:jubaourl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];

}
-(void)withdraw:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:withdrawurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}
-(void)yinshen:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:yinshenurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}
-(void)yinshen_list:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:yinshen_listurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)modifypass:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:modifypassurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
    
}
-(void)feedback:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:feedbackurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];

}
-(void)importContact:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:importContacturl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   //xhw2018-1-17改
//                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   AddressBookFriendModel *focusModel = [[AddressBookFriendModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];


}
-(void)dakalists:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:dakalistsurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           NSMutableDictionary *dic = [result objectForKey:@"state"];
                           if( [[dic objectForKey:@"code"] intValue]== 1){
                               failure([dic objectForKey:@"msg"]);
                               return ;
                           }
                           NSMutableArray *newsObjs = [result objectForKey:@"data"];
                           
                           if ([newsObjs count]==0) {
                               success(newsObjs);
                               return;
                           }
                           if (![newsObjs isKindOfClass:[NSNull class]]) {
                               NSMutableArray *userlist = [[NSMutableArray alloc] init];
                               for (id newsObj in newsObjs) {
                                   LoginResponseModel *focusModel = [[LoginResponseModel alloc] init];
                                   [focusModel serializationWithDictionary:newsObj];
                                   [userlist addObject:focusModel];
                               }
                               success(userlist);
                           }
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}
-(void)addDaka:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:addDakaurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"state"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];


}
-(void)memberCenter:(NSMutableDictionary *)parameters success:(void (^)(id))success failure:(void (^)(id))failure{
    [self.http sendRequest:memberCenterurl
                Parameters:parameters
                   Timeout:REQUEST_MAX_TIMEOUT
                    Method:GET_METHOD
                   Success:^(id result) {
                       if ([result isKindOfClass:[NSMutableDictionary class]]||[result isKindOfClass:[NSDictionary class]]) {
                           LoginResponseModel *loginModel = [[LoginResponseModel alloc] init];
                           [loginModel serializationWithDictionary:[result objectForKey:@"data"]];
                           if([loginModel.code intValue] ==1){
                               failure(loginModel.msg);
                               return ;
                           }
                           success(loginModel);
                       } else {
                           failure(@"服务器内部错误");
                       }
                   }
                   Failure:^(NSString *message, NSError *error) {
                       failure(message);
                   }];
}


@end
